package com.sun.mybatisplus.bean;


import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDate;

@Data
@TableName(value = "user")//设置实体类对应的表明
public class User extends User2 implements Serializable {
    /**
     * tableId type
     *      AUTO(0),  自增
     *      NONE(1),
     *      INPUT(2),
     *      ID_WORKER(3),
     *      UUID(4),
     *      ID_WORKER_STR(5);
     */
    //指定属性为主键
    @ApiModelProperty(value = "主键")
    @TableField(value = "id")
    @Excel(name = "主键",orderNum = "1")
    private Long id;
    //指定表字段名对应的实体类属性名
    @NotNull(message = "名字不能为空")
    @ApiModelProperty(value = "名字")
    @TableField(value = "name")
    @Excel(name = "姓名",orderNum = "2")
    private String name;
    @ApiModelProperty(value = "年龄")
    @Excel(name = "年龄",orderNum = "3")
    private Integer age;
    @TableField(value = "enable_Set")
    private Byte enableSet = 0;
    @TableField(exist = false)
    private UserExt userExt;
    @TableField(exist = false)
    private String names;
    @TableField(value = "ags")
    @ApiModelProperty(value = "年龄s")
    private String agss;
    @JsonFormat(pattern = "yyyy.MM.dd")
    private LocalDate date;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
        this.names = name;
    }

    public User() {

    }
    //    private List list;
//    @TableLogic
//    @TableField(value = "deleteId")
//    @TableField(exist = false)
//    private Integer deleteId;

}
